1. Field of the Invention
The present invention relates to a barrel shifter which can implement a carry-including rotate operation at a high speed by calculating the amount of shift in dependence upon a hardware configuration, without depending upon software.
2. Description of the Prior Art
The carry-bit including rotation operation such that information is circulated together with a carry bit by unit of bits can be implemented by a barrel shifter. In the conventional barrel shifter, the carry-including rotation operation has been executed in accordance with microprogram by the aid of a register, so that there exists a problem in that the execution time is relatively long. To overcome this problem, the same inventors have co-filed U.S. patent application Ser. No. 07/102,343, entitled "Highly Responsive Barrel Shifter", on Sept., 29, 1987, by which an input data can be rotated at high speed together with a carry bit by means of only hardware (logic gates).
In this novel barrel shifter, however, there still exists a problem such that it is impossible to implement carry-excluding rotation operation or carry-including rotation operation in response to shift signals indicative of shift counts where an N-bit or less input data is given to an N-bit barrel shifter and further an N-bit or more shift count is instructed.
This is because in a rotation operation, any input data should periodically be repeated according to bit length of the input data, irrespective of the amount of rotate (referred to as rotate count). That is, in the rotation operation of an N-bit length input data, the rotated data are always the same at each rotation operation. In other words, if the rotate count is designated as x, a remainder (referred to as modulo x/N) of a division x/N becomes an actual rotate count.
However, when an N-bit or less input data is rotated together with a carry by an N-bit or more rotate count, since the modulo changes to modulo x/N+1, it is impossible to implement carry-including rotation operation by simply masking shift signals, as described later in greater detail. Therefore, the shift count or the modulo x/N+1 should be calculated in order to implement a carry-including rotation operation whenever an N-bit or less data is rotated together with a carry by an N-bit or more rotate count.
The above shift or rotate signal calculation may be executed in accordance with software. However, it takes a relatively long execution time.
The configuration and operation of this co-filled barrel shifter will be described in greater detail hereinafter with reference to the attached drawings under DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS.